<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <link rel="stylesheet" href="/js/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/css/common.css" media="all">
  <script src="/js/layui/layui.js"></script>
    <!--<script src="/admin/js/token.js"></script>-->
</head>
<body>

<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
      <div class="layui-form-item">

        <div class="layui-inline">
          <label class="layui-form-label">区域</label>
          <div class="layui-input-block">
            <select name="role">
              <option value="0">西北</option>
              <option value="1">西南</option>
              <option value="2">华东</option>
              <option value="3">华北</option>
              <option value="4">华中</option>
              <option value="5">华南</option>
            </select>
          </div>
        </div>

        <div class="layui-inline">
          <div class="layui-form">
            <div class="layui-form-item">
              <div class="layui-input-inline">
                <input type="text" class="layui-input" id="starttime" placeholder="输入站点创建开始时间">
              </div>
              <div class="layui-form-mid">
                -
              </div>
              <div class="layui-input-inline">
                <input type="text" class="layui-input" id="endtime" placeholder="输入站点创建结束时间">
              </div>
            </div>
          </div>
        </div>

        <div class="layui-inline">
          <div class="layui-input-block">
            <input type="text" name="telphone" placeholder="输入站点名称或站点编号" autocomplete="off" class="layui-input">
          </div>
        </div>

        <div class="layui-inline">
          <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search">
            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
          </button>
        </div>
      </div>
    </div>



    <div class="layui-card-body">
      <button class="layui-btn layui-btn-sm layui-icon layui-icon-form" >站点类型</button>
      <button class="layui-btn layui-btn-sm layui-icon layui-icon-add-circle" >新增站点</button>
      <table class="layui-hide" id="t" lay-filter="t"></table>
    </div>

  </div>
</div>


</body>

<script type="text/html" id="tb">
  <div class="layui-container">
    <span class="">站点列表</span>
  </div>
</script>

<script type="text/html" id="caozuo">
  <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">火币充值</a>
</script>
<script>
  layui.use('laydate', function () {
    var laydate = layui.laydate

    //日期时间选择器
    laydate.render({
      elem: '#starttime'
      , type: 'datetime'
    })
    laydate.render({
      elem: '#endtime'
      , type: 'datetime'
    })
  })

  layui.use('table', function () {
    var $ = layui.$
    var table = layui.table
    table.render({
      elem: '#t',
      id: 'tt',
      toolbar: '#tb',
      url: '/admin/terminal/selectTerminal',
      cols: [
        [{
          field: 'terminal_id',
          title: '站点编号',
          width: '180',
          align: 'center'
        },
          {
            field: 'station_bh',
            title: '站点名称',
            width: '200',
            align: 'center'
          },
          {
            field: 'terminal_key',
            title: '已绑定终端数',
            width: '230',
            align: 'center'
          },
          {
            field: 'terminal_ip',
            title: '火币数',
            width: '170',
            align: 'center'
          },
          {
            field: 'terminal_mac',
            title: '上级用户名',
            width: '220',
            align: 'center'
          },
          {
            title: '操作',
            width: '200',
            align: 'center',
            toolbar: '#caozuo',
            fixed: 'right'
          }
        ]
      ],
      page: true,
      limit:40
    })

    //监听工具条
    table.on('tool(t)', function (obj) {
      var data = obj.data
      if (obj.event === 'detail') {
        layer.msg('ID：' + data.id + ' 的查看操作')
      } else if (obj.event === 'del') {
        layer.confirm('真的删除行么', function (index) {
          obj.del()
          layer.close(index)
        })
      } else if (obj.event === 'edit') {
        layer.alert('编辑行：<br>' + JSON.stringify(data))
      }
    })

    $('.test-table-operate-btn .layui-btn').on('click', function () {
      var type = $(this).data('type')
      active[type] ? active[type].call(this) : ''
    })
  })
</script>
</html>
